Bind RHS of comma expressions too#47049
Conversation
|
@typescript-bot perf test this |
|
Heya @jakebailey, I've started to run the parallelized community code test suite on this PR at 5be2594. You can monitor the build here. |
|
Heya @jakebailey, I've started to run the perf test suite on this PR at 5be2594. You can monitor the build here. Update: The results are in! |
|
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
|
@jakebailey Here they are:Comparison Report - main..47049
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
src/compiler/binder.ts
Outdated
| if (!state.skip) { | ||
| const operator = node.operatorToken.kind; | ||
|
|
||
| if (operator === SyntaxKind.CommaToken) { |
There was a problem hiding this comment.
Why would this be in onExit and not onRight?
There was a problem hiding this comment.
If you look up a bit, the node.left is processed in onOperator, presumably because there's some work that is completed after onLeft is completed. That's how it was added in #44487.
I tried putting it into onRight first and hit infinite recursion, then realized that the other call wasn't in onLeft and moved it down.
There was a problem hiding this comment.
Perhaps I can get away with moving these around, though, and try running them after maybeBind in onLeft and onRight instead. I'll try it. It'd sure look less weird.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
I've moved things around to be a little less surprising.
Fixes #44487
This is an extension of #41312, applying
maybeBindExpressionFlowIfCallthe RHS too. The argument there was:I'd argue that this means that the entire chain of items in a comma expression (of any size) should have this applied, since they are being thought of here as a list of statements with potential side effects, and not just the leftmost expression.